package com.example.mapper;

import com.example.pojo.Activity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
/*
活动管理dao层
 */
@Mapper
public interface ActivityMapper {
    //添加活动
    void InsertActivity(Activity activity);

    //根据发布状态活动查询,查询结果列表按照创建时间或发布时间的降序排列
    @Select("select * from t_manager_activity where status = #{status} order by created_time desc")
    List<Activity> queryActivityByStatus(String status);

    //根据活动id查询
    @Select("select * from t_manager_activity where id = #{id}")
    Activity queryActivityById(Integer id);

    //活动编辑
    void updateActivity(Activity activity);



}
